package cn.walls1717.ggkt.client.activity;

import cn.walls1717.ggkt.model.activity.CouponInfo;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * 优惠券远程调用接口
 *
 * @author walls1717
 * @since 2022/7/22
 */
@FeignClient("service-activity")
public interface CouponInfoFeignClient {

    /**
     * 根据优惠券id回去优惠券
     *
     * @param couponId 优惠券id
     * @return 优惠券信息
     */
    @ApiOperation("获取优惠券")
    @GetMapping("/api/activity/couponInfo/inner/getById/{couponId}")
    CouponInfo innerGetCouponById(@PathVariable("couponId") Long couponId);

    /**
     * 更新优惠券使用状态
     *
     * @param couponUseId 优惠券id
     * @param orderId 订单id
     * @return 是否更新成功
     */
    @ApiOperation("更新优惠券使用状态")
    @GetMapping("/api/activity/couponInfo/inner/updateCouponInfoUseStatus/{couponUseId}/{orderId}")
    Boolean innerUpdateCouponInfoUseStatus(@PathVariable("couponUseId") Long couponUseId, @PathVariable("orderId") Long orderId);

}